#ifndef VEHICLEPAGE_H
#define VEHICLEPAGE_H
#include <QObject>
#include <QWidget>
#include <QTcpSocket>
#include <QJsonObject>
#include <QVBoxLayout>


namespace Ui {
class VehiclePage;
}

class VehiclePage : public QWidget
{
    Q_OBJECT

public:
    explicit VehiclePage(QWidget *parent = nullptr,QTcpSocket* externalSocket = nullptr);
    ~VehiclePage();
    QSet<QString> getValidPrefixes();
    bool isValidLicensePlate(const QString& plate);

public slots:
    void on_pushButton_in_car_clicked();
    //void readServerMessage();
    void handleServerMessage(const QJsonObject& json);
    void handleIncarMessage(const QJsonObject& json);
    void handleOutncarMessage(const QJsonObject& json);
    void onPushButtons();
private slots:
    void on_pushButton_out_car_clicked();

private:
    Ui::VehiclePage *ui;
    QTcpSocket* socket;
    QVBoxLayout* mainLayout;
    QHBoxLayout* inCarLayout;
    QHBoxLayout* outCarLayout;
};

#endif // VEHICLEPAGE_H
